package b.b.h;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources.NotFoundException;
import android.graphics.PorterDuff.Mode;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.widget.TextView;
import b.b.b;
import b.i.c.b.g;
import java.lang.ref.WeakReference;
import java.util.Arrays;

/* compiled from: AppCompatTextHelper */
public class k {
    public final TextView a;
    public d0 b;
    public d0 c;
    public d0 d;
    public d0 e;
    public d0 f;
    public d0 g;
    public d0 h;
    public final l i;
    public int j = 0;
    public int k = -1;
    public Typeface l;
    public boolean m;

    /* compiled from: AppCompatTextHelper */
    public class a extends g {
        public final /* synthetic */ int a;
        public final /* synthetic */ int b;
        public final /* synthetic */ WeakReference c;

        public a(int i, int i2, WeakReference weakReference) {
            this.a = i;
            this.b = i2;
            this.c = weakReference;
        }

        public void c(int i) {
        }

        public void d(Typeface typeface) {
            if (VERSION.SDK_INT >= 28) {
                int i = this.a;
                if (i != -1) {
                    typeface = Typeface.create(typeface, i, (this.b & 2) != 0);
                }
            }
            k kVar = k.this;
            WeakReference weakReference = this.c;
            if (kVar.m) {
                kVar.l = typeface;
                TextView textView = (TextView) weakReference.get();
                if (textView != null) {
                    textView.setTypeface(typeface, kVar.j);
                }
            }
        }
    }

    public k(TextView textView) {
        this.a = textView;
        this.i = new l(textView);
    }

    public static d0 c(Context context, e eVar, int i) {
        ColorStateList d = eVar.d(context, i);
        if (d == null) {
            return null;
        }
        d0 d0Var = new d0();
        d0Var.d = true;
        d0Var.a = d;
        return d0Var;
    }

    public final void a(Drawable drawable, d0 d0Var) {
        if (drawable != null && d0Var != null) {
            e.f(drawable, d0Var, this.a.getDrawableState());
        }
    }

    public void b() {
        Drawable[] compoundDrawables;
        if (!(this.b == null && this.c == null && this.d == null && this.e == null)) {
            compoundDrawables = this.a.getCompoundDrawables();
            a(compoundDrawables[0], this.b);
            a(compoundDrawables[1], this.c);
            a(compoundDrawables[2], this.d);
            a(compoundDrawables[3], this.e);
        }
        if (this.f != null || this.g != null) {
            compoundDrawables = this.a.getCompoundDrawablesRelative();
            a(compoundDrawables[0], this.f);
            a(compoundDrawables[2], this.g);
        }
    }

    public boolean d() {
        l lVar = this.i;
        return lVar.i() && lVar.a != 0;
    }

    /* JADX WARNING: Removed duplicated region for block: B:44:0x010e  */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x0107  */
    /* JADX WARNING: Removed duplicated region for block: B:155:0x02fa  */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x02c2  */
    /* JADX WARNING: Removed duplicated region for block: B:158:0x0301  */
    /* JADX WARNING: Removed duplicated region for block: B:169:0x0351  */
    /* JADX WARNING: Removed duplicated region for block: B:168:0x034a  */
    /* JADX WARNING: Removed duplicated region for block: B:173:0x0361  */
    /* JADX WARNING: Removed duplicated region for block: B:172:0x035c  */
    /* JADX WARNING: Removed duplicated region for block: B:177:0x036f  */
    /* JADX WARNING: Removed duplicated region for block: B:176:0x036a  */
    /* JADX WARNING: Removed duplicated region for block: B:181:0x037c  */
    /* JADX WARNING: Removed duplicated region for block: B:180:0x0377  */
    /* JADX WARNING: Removed duplicated region for block: B:185:0x038a  */
    /* JADX WARNING: Removed duplicated region for block: B:184:0x0385  */
    /* JADX WARNING: Removed duplicated region for block: B:189:0x0397  */
    /* JADX WARNING: Removed duplicated region for block: B:188:0x0392  */
    /* JADX WARNING: Removed duplicated region for block: B:219:0x03fa  */
    /* JADX WARNING: Removed duplicated region for block: B:221:0x0401  */
    /* JADX WARNING: Removed duplicated region for block: B:223:0x0406  */
    /* JADX WARNING: Removed duplicated region for block: B:225:0x040c  */
    /* JADX WARNING: Removed duplicated region for block: B:229:0x041a  */
    /* JADX WARNING: Removed duplicated region for block: B:244:0x0450  */
    /* JADX WARNING: Removed duplicated region for block: B:252:0x0486  */
    /* JADX WARNING: Removed duplicated region for block: B:254:0x048d  */
    /* JADX WARNING: Removed duplicated region for block: B:259:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Removed duplicated region for block: B:256:0x0494  */
    /* JADX WARNING: Removed duplicated region for block: B:111:0x0247  */
    /* JADX WARNING: Removed duplicated region for block: B:115:0x025c  */
    /* JADX WARNING: Removed duplicated region for block: B:114:0x0257  */
    /* JADX WARNING: Removed duplicated region for block: B:119:0x026b  */
    /* JADX WARNING: Removed duplicated region for block: B:118:0x0265  */
    /* JADX WARNING: Removed duplicated region for block: B:123:0x0279  */
    /* JADX WARNING: Removed duplicated region for block: B:122:0x0274  */
    /* JADX WARNING: Removed duplicated region for block: B:126:0x0282  */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x02c2  */
    /* JADX WARNING: Removed duplicated region for block: B:155:0x02fa  */
    /* JADX WARNING: Removed duplicated region for block: B:158:0x0301  */
    /* JADX WARNING: Removed duplicated region for block: B:168:0x034a  */
    /* JADX WARNING: Removed duplicated region for block: B:169:0x0351  */
    /* JADX WARNING: Removed duplicated region for block: B:172:0x035c  */
    /* JADX WARNING: Removed duplicated region for block: B:173:0x0361  */
    /* JADX WARNING: Removed duplicated region for block: B:176:0x036a  */
    /* JADX WARNING: Removed duplicated region for block: B:177:0x036f  */
    /* JADX WARNING: Removed duplicated region for block: B:180:0x0377  */
    /* JADX WARNING: Removed duplicated region for block: B:181:0x037c  */
    /* JADX WARNING: Removed duplicated region for block: B:184:0x0385  */
    /* JADX WARNING: Removed duplicated region for block: B:185:0x038a  */
    /* JADX WARNING: Removed duplicated region for block: B:188:0x0392  */
    /* JADX WARNING: Removed duplicated region for block: B:189:0x0397  */
    /* JADX WARNING: Removed duplicated region for block: B:191:0x039a A:{SKIP} */
    /* JADX WARNING: Removed duplicated region for block: B:219:0x03fa  */
    /* JADX WARNING: Removed duplicated region for block: B:221:0x0401  */
    /* JADX WARNING: Removed duplicated region for block: B:223:0x0406  */
    /* JADX WARNING: Removed duplicated region for block: B:225:0x040c  */
    /* JADX WARNING: Removed duplicated region for block: B:229:0x041a  */
    /* JADX WARNING: Removed duplicated region for block: B:244:0x0450  */
    /* JADX WARNING: Removed duplicated region for block: B:252:0x0486  */
    /* JADX WARNING: Removed duplicated region for block: B:254:0x048d  */
    /* JADX WARNING: Removed duplicated region for block: B:256:0x0494  */
    /* JADX WARNING: Removed duplicated region for block: B:259:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Missing block: B:234:0x042b, code skipped:
            if (r4 != null) goto L_0x0432;
     */
    @android.annotation.SuppressLint({"NewApi"})
    public void e(android.util.AttributeSet r28, int r29) {
        /*
        r27 = this;
        r0 = r27;
        r8 = r28;
        r9 = r29;
        r10 = b.b.b.i;
        r11 = b.b.b.w;
        r12 = android.os.Build.VERSION.SDK_INT;
        r1 = r0.a;
        r13 = r1.getContext();
        r14 = b.b.h.e.a();
        r3 = b.b.b.h;
        r15 = 0;
        r7 = b.b.h.f0.q(r13, r8, r3, r9, r15);
        r1 = r0.a;
        r2 = r1.getContext();
        r5 = r7.b;
        r16 = 0;
        r4 = r28;
        r6 = r29;
        r15 = r7;
        r7 = r16;
        b.i.k.o.o(r1, r2, r3, r4, r5, r6, r7);
        r7 = -1;
        r1 = 0;
        r2 = r15.l(r1, r7);
        r6 = 3;
        r3 = r15.o(r6);
        if (r3 == 0) goto L_0x0048;
    L_0x003e:
        r3 = r15.l(r6, r1);
        r3 = c(r13, r14, r3);
        r0.b = r3;
    L_0x0048:
        r5 = 1;
        r3 = r15.o(r5);
        if (r3 == 0) goto L_0x0059;
    L_0x004f:
        r3 = r15.l(r5, r1);
        r3 = c(r13, r14, r3);
        r0.c = r3;
    L_0x0059:
        r4 = 4;
        r3 = r15.o(r4);
        if (r3 == 0) goto L_0x006a;
    L_0x0060:
        r3 = r15.l(r4, r1);
        r3 = c(r13, r14, r3);
        r0.d = r3;
    L_0x006a:
        r3 = 2;
        r16 = r15.o(r3);
        if (r16 == 0) goto L_0x007b;
    L_0x0071:
        r5 = r15.l(r3, r1);
        r5 = c(r13, r14, r5);
        r0.e = r5;
    L_0x007b:
        r5 = 5;
        r17 = r15.o(r5);
        if (r17 == 0) goto L_0x008c;
    L_0x0082:
        r3 = r15.l(r5, r1);
        r3 = c(r13, r14, r3);
        r0.f = r3;
    L_0x008c:
        r3 = 6;
        r17 = r15.o(r3);
        if (r17 == 0) goto L_0x009d;
    L_0x0093:
        r5 = r15.l(r3, r1);
        r1 = c(r13, r14, r5);
        r0.g = r1;
    L_0x009d:
        r1 = r15.b;
        r1.recycle();
        r1 = r0.a;
        r1 = r1.getTransformationMethod();
        r1 = r1 instanceof android.text.method.PasswordTransformationMethod;
        r5 = 23;
        r15 = 14;
        if (r2 == r7) goto L_0x0129;
    L_0x00b0:
        r3 = new b.b.h.f0;
        r2 = r13.obtainStyledAttributes(r2, r11);
        r3.m330init(r13, r2);
        if (r1 != 0) goto L_0x00c8;
    L_0x00bb:
        r2 = r3.o(r15);
        if (r2 == 0) goto L_0x00c8;
    L_0x00c1:
        r2 = 0;
        r21 = r3.a(r15, r2);
        r2 = 1;
        goto L_0x00cb;
    L_0x00c8:
        r2 = 0;
        r21 = 0;
    L_0x00cb:
        r0.l(r13, r3);
        if (r12 >= r5) goto L_0x00f9;
    L_0x00d0:
        r22 = r3.o(r6);
        if (r22 == 0) goto L_0x00db;
    L_0x00d6:
        r22 = r3.c(r6);
        goto L_0x00dd;
    L_0x00db:
        r22 = 0;
    L_0x00dd:
        r23 = r3.o(r4);
        if (r23 == 0) goto L_0x00e9;
    L_0x00e3:
        r23 = r3.c(r4);
        r7 = 5;
        goto L_0x00ec;
    L_0x00e9:
        r7 = 5;
        r23 = 0;
    L_0x00ec:
        r18 = r3.o(r7);
        if (r18 == 0) goto L_0x00fd;
    L_0x00f2:
        r24 = r3.c(r7);
        r7 = 15;
        goto L_0x0101;
    L_0x00f9:
        r22 = 0;
        r23 = 0;
    L_0x00fd:
        r7 = 15;
        r24 = 0;
    L_0x0101:
        r19 = r3.o(r7);
        if (r19 == 0) goto L_0x010e;
    L_0x0107:
        r25 = r3.m(r7);
        r7 = 26;
        goto L_0x0112;
    L_0x010e:
        r7 = 26;
        r25 = 0;
    L_0x0112:
        if (r12 < r7) goto L_0x0121;
    L_0x0114:
        r7 = 13;
        r20 = r3.o(r7);
        if (r20 == 0) goto L_0x0121;
    L_0x011c:
        r26 = r3.m(r7);
        goto L_0x0123;
    L_0x0121:
        r26 = 0;
    L_0x0123:
        r3 = r3.b;
        r3.recycle();
        goto L_0x0136;
    L_0x0129:
        r2 = 0;
        r21 = 0;
        r22 = 0;
        r23 = 0;
        r24 = 0;
        r25 = 0;
        r26 = 0;
    L_0x0136:
        r3 = new b.b.h.f0;
        r7 = 0;
        r11 = r13.obtainStyledAttributes(r8, r11, r9, r7);
        r3.m330init(r13, r11);
        if (r1 != 0) goto L_0x0150;
    L_0x0142:
        r11 = r3.o(r15);
        if (r11 == 0) goto L_0x0150;
    L_0x0148:
        r21 = r3.a(r15, r7);
        r7 = r21;
        r2 = 1;
        goto L_0x0152;
    L_0x0150:
        r7 = r21;
    L_0x0152:
        if (r12 >= r5) goto L_0x0173;
    L_0x0154:
        r5 = r3.o(r6);
        if (r5 == 0) goto L_0x015e;
    L_0x015a:
        r22 = r3.c(r6);
    L_0x015e:
        r5 = r3.o(r4);
        if (r5 == 0) goto L_0x0168;
    L_0x0164:
        r23 = r3.c(r4);
    L_0x0168:
        r5 = 5;
        r11 = r3.o(r5);
        if (r11 == 0) goto L_0x0173;
    L_0x016f:
        r24 = r3.c(r5);
    L_0x0173:
        r11 = r22;
        r4 = r23;
        r5 = r24;
        r6 = 15;
        r22 = r3.o(r6);
        if (r22 == 0) goto L_0x0185;
    L_0x0181:
        r25 = r3.m(r6);
    L_0x0185:
        r6 = r25;
        r15 = 26;
        if (r12 < r15) goto L_0x0198;
    L_0x018b:
        r15 = 13;
        r20 = r3.o(r15);
        if (r20 == 0) goto L_0x019a;
    L_0x0193:
        r26 = r3.m(r15);
        goto L_0x019a;
    L_0x0198:
        r15 = 13;
    L_0x019a:
        r22 = r14;
        r15 = r26;
        r14 = 28;
        if (r12 < r14) goto L_0x01b6;
    L_0x01a2:
        r14 = 0;
        r17 = r3.o(r14);
        if (r17 == 0) goto L_0x01b6;
    L_0x01a9:
        r8 = -1;
        r17 = r3.f(r14, r8);
        if (r17 != 0) goto L_0x01b6;
    L_0x01b0:
        r8 = r0.a;
        r9 = 0;
        r8.setTextSize(r14, r9);
    L_0x01b6:
        r0.l(r13, r3);
        r3 = r3.b;
        r3.recycle();
        if (r11 == 0) goto L_0x01c5;
    L_0x01c0:
        r3 = r0.a;
        r3.setTextColor(r11);
    L_0x01c5:
        if (r4 == 0) goto L_0x01cc;
    L_0x01c7:
        r3 = r0.a;
        r3.setHintTextColor(r4);
    L_0x01cc:
        if (r5 == 0) goto L_0x01d3;
    L_0x01ce:
        r3 = r0.a;
        r3.setLinkTextColor(r5);
    L_0x01d3:
        if (r1 != 0) goto L_0x01dc;
    L_0x01d5:
        if (r2 == 0) goto L_0x01dc;
    L_0x01d7:
        r1 = r0.a;
        r1.setAllCaps(r7);
    L_0x01dc:
        r1 = r0.l;
        if (r1 == 0) goto L_0x01f3;
    L_0x01e0:
        r2 = r0.k;
        r7 = -1;
        if (r2 != r7) goto L_0x01ed;
    L_0x01e5:
        r2 = r0.a;
        r3 = r0.j;
        r2.setTypeface(r1, r3);
        goto L_0x01f4;
    L_0x01ed:
        r2 = r0.a;
        r2.setTypeface(r1);
        goto L_0x01f4;
    L_0x01f3:
        r7 = -1;
    L_0x01f4:
        if (r15 == 0) goto L_0x01fb;
    L_0x01f6:
        r1 = r0.a;
        r1.setFontVariationSettings(r15);
    L_0x01fb:
        r8 = 24;
        if (r6 == 0) goto L_0x0220;
    L_0x01ff:
        if (r12 < r8) goto L_0x020b;
    L_0x0201:
        r1 = r0.a;
        r2 = android.os.LocaleList.forLanguageTags(r6);
        r1.setTextLocales(r2);
        goto L_0x0220;
    L_0x020b:
        r1 = 44;
        r1 = r6.indexOf(r1);
        r2 = 0;
        r1 = r6.substring(r2, r1);
        r3 = r0.a;
        r1 = java.util.Locale.forLanguageTag(r1);
        r3.setTextLocale(r1);
        goto L_0x0221;
    L_0x0220:
        r2 = 0;
    L_0x0221:
        r9 = r0.i;
        r1 = r9.j;
        r11 = r28;
        r6 = r29;
        r14 = r1.obtainStyledAttributes(r11, r10, r6, r2);
        r1 = r9.i;
        r2 = r1.getContext();
        r15 = 0;
        r4 = 6;
        r5 = 0;
        r8 = 2;
        r3 = r10;
        r8 = 4;
        r4 = r28;
        r8 = 5;
        r5 = r14;
        r7 = r15;
        b.i.k.o.o(r1, r2, r3, r4, r5, r6, r7);
        r1 = r14.hasValue(r8);
        if (r1 == 0) goto L_0x024e;
    L_0x0247:
        r1 = 0;
        r2 = r14.getInt(r8, r1);
        r9.a = r2;
    L_0x024e:
        r1 = 4;
        r2 = r14.hasValue(r1);
        r3 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        if (r2 == 0) goto L_0x025c;
    L_0x0257:
        r1 = r14.getDimension(r1, r3);
        goto L_0x025e;
    L_0x025c:
        r1 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
    L_0x025e:
        r2 = 2;
        r4 = r14.hasValue(r2);
        if (r4 == 0) goto L_0x026b;
    L_0x0265:
        r4 = r14.getDimension(r2, r3);
        r2 = 1;
        goto L_0x026e;
    L_0x026b:
        r2 = 1;
        r4 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
    L_0x026e:
        r5 = r14.hasValue(r2);
        if (r5 == 0) goto L_0x0279;
    L_0x0274:
        r5 = r14.getDimension(r2, r3);
        goto L_0x027b;
    L_0x0279:
        r5 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
    L_0x027b:
        r6 = 3;
        r7 = r14.hasValue(r6);
        if (r7 == 0) goto L_0x02b8;
    L_0x0282:
        r7 = 0;
        r8 = r14.getResourceId(r6, r7);
        if (r8 <= 0) goto L_0x02b8;
    L_0x0289:
        r7 = r14.getResources();
        r7 = r7.obtainTypedArray(r8);
        r8 = r7.length();
        r15 = new int[r8];
        if (r8 <= 0) goto L_0x02b3;
    L_0x0299:
        r6 = 0;
    L_0x029a:
        if (r6 >= r8) goto L_0x02a8;
    L_0x029c:
        r3 = -1;
        r16 = r7.getDimensionPixelSize(r6, r3);
        r15[r6] = r16;
        r6 = r6 + 1;
        r3 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        goto L_0x029a;
    L_0x02a8:
        r3 = -1;
        r6 = r9.b(r15);
        r9.f = r6;
        r9.h();
        goto L_0x02b4;
    L_0x02b3:
        r3 = -1;
    L_0x02b4:
        r7.recycle();
        goto L_0x02b9;
    L_0x02b8:
        r3 = -1;
    L_0x02b9:
        r14.recycle();
        r6 = r9.i();
        if (r6 == 0) goto L_0x02fa;
    L_0x02c2:
        r6 = r9.a;
        if (r6 != r2) goto L_0x02fd;
    L_0x02c6:
        r6 = r9.g;
        if (r6 != 0) goto L_0x02f6;
    L_0x02ca:
        r6 = r9.j;
        r6 = r6.getResources();
        r6 = r6.getDisplayMetrics();
        r7 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        r8 = (r4 > r7 ? 1 : (r4 == r7 ? 0 : -1));
        if (r8 != 0) goto L_0x02e2;
    L_0x02da:
        r4 = 1094713344; // 0x41400000 float:12.0 double:5.408602553E-315;
        r8 = 2;
        r4 = android.util.TypedValue.applyDimension(r8, r4, r6);
        goto L_0x02e3;
    L_0x02e2:
        r8 = 2;
    L_0x02e3:
        r14 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1));
        if (r14 != 0) goto L_0x02ed;
    L_0x02e7:
        r5 = 1121976320; // 0x42e00000 float:112.0 double:5.54329955E-315;
        r5 = android.util.TypedValue.applyDimension(r8, r5, r6);
    L_0x02ed:
        r6 = (r1 > r7 ? 1 : (r1 == r7 ? 0 : -1));
        if (r6 != 0) goto L_0x02f3;
    L_0x02f1:
        r1 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
    L_0x02f3:
        r9.j(r4, r5, r1);
    L_0x02f6:
        r9.g();
        goto L_0x02fd;
    L_0x02fa:
        r1 = 0;
        r9.a = r1;
    L_0x02fd:
        r1 = b.i.l.b.a0;
        if (r1 == 0) goto L_0x033e;
    L_0x0301:
        r1 = r0.i;
        r4 = r1.a;
        if (r4 == 0) goto L_0x033e;
    L_0x0307:
        r1 = r1.f;
        r4 = r1.length;
        if (r4 <= 0) goto L_0x033e;
    L_0x030c:
        r4 = r0.a;
        r4 = r4.getAutoSizeStepGranularity();
        r4 = (float) r4;
        r5 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        r4 = (r4 > r5 ? 1 : (r4 == r5 ? 0 : -1));
        if (r4 == 0) goto L_0x0338;
    L_0x0319:
        r1 = r0.a;
        r4 = r0.i;
        r4 = r4.d;
        r4 = java.lang.Math.round(r4);
        r5 = r0.i;
        r5 = r5.e;
        r5 = java.lang.Math.round(r5);
        r6 = r0.i;
        r6 = r6.c;
        r6 = java.lang.Math.round(r6);
        r7 = 0;
        r1.setAutoSizeTextTypeUniformWithConfiguration(r4, r5, r6, r7);
        goto L_0x033e;
    L_0x0338:
        r7 = 0;
        r4 = r0.a;
        r4.setAutoSizeTextTypeUniformWithPresetSizes(r1, r7);
    L_0x033e:
        r1 = r13.obtainStyledAttributes(r11, r10);
        r4 = 8;
        r4 = r1.getResourceId(r4, r3);
        if (r4 == r3) goto L_0x0351;
    L_0x034a:
        r5 = r22;
        r4 = r5.b(r13, r4);
        goto L_0x0354;
    L_0x0351:
        r5 = r22;
        r4 = 0;
    L_0x0354:
        r6 = 13;
        r6 = r1.getResourceId(r6, r3);
        if (r6 == r3) goto L_0x0361;
    L_0x035c:
        r6 = r5.b(r13, r6);
        goto L_0x0362;
    L_0x0361:
        r6 = 0;
    L_0x0362:
        r7 = 9;
        r7 = r1.getResourceId(r7, r3);
        if (r7 == r3) goto L_0x036f;
    L_0x036a:
        r7 = r5.b(r13, r7);
        goto L_0x0370;
    L_0x036f:
        r7 = 0;
    L_0x0370:
        r8 = 6;
        r8 = r1.getResourceId(r8, r3);
        if (r8 == r3) goto L_0x037c;
    L_0x0377:
        r8 = r5.b(r13, r8);
        goto L_0x037d;
    L_0x037c:
        r8 = 0;
    L_0x037d:
        r9 = 10;
        r9 = r1.getResourceId(r9, r3);
        if (r9 == r3) goto L_0x038a;
    L_0x0385:
        r9 = r5.b(r13, r9);
        goto L_0x038b;
    L_0x038a:
        r9 = 0;
    L_0x038b:
        r10 = 7;
        r10 = r1.getResourceId(r10, r3);
        if (r10 == r3) goto L_0x0397;
    L_0x0392:
        r5 = r5.b(r13, r10);
        goto L_0x0398;
    L_0x0397:
        r5 = 0;
    L_0x0398:
        if (r9 != 0) goto L_0x03ef;
    L_0x039a:
        if (r5 == 0) goto L_0x039d;
    L_0x039c:
        goto L_0x03ef;
    L_0x039d:
        if (r4 != 0) goto L_0x03a5;
    L_0x039f:
        if (r6 != 0) goto L_0x03a5;
    L_0x03a1:
        if (r7 != 0) goto L_0x03a5;
    L_0x03a3:
        if (r8 == 0) goto L_0x0412;
    L_0x03a5:
        r5 = r0.a;
        r5 = r5.getCompoundDrawablesRelative();
        r9 = 0;
        r10 = r5[r9];
        if (r10 != 0) goto L_0x03d8;
    L_0x03b0:
        r10 = 2;
        r11 = r5[r10];
        if (r11 == 0) goto L_0x03b6;
    L_0x03b5:
        goto L_0x03d8;
    L_0x03b6:
        r5 = r0.a;
        r5 = r5.getCompoundDrawables();
        r10 = r0.a;
        if (r4 == 0) goto L_0x03c1;
    L_0x03c0:
        goto L_0x03c3;
    L_0x03c1:
        r4 = r5[r9];
    L_0x03c3:
        if (r6 == 0) goto L_0x03c6;
    L_0x03c5:
        goto L_0x03c8;
    L_0x03c6:
        r6 = r5[r2];
    L_0x03c8:
        if (r7 == 0) goto L_0x03cb;
    L_0x03ca:
        goto L_0x03ce;
    L_0x03cb:
        r2 = 2;
        r7 = r5[r2];
    L_0x03ce:
        if (r8 == 0) goto L_0x03d1;
    L_0x03d0:
        goto L_0x03d4;
    L_0x03d1:
        r2 = 3;
        r8 = r5[r2];
    L_0x03d4:
        r10.setCompoundDrawablesWithIntrinsicBounds(r4, r6, r7, r8);
        goto L_0x0412;
    L_0x03d8:
        r4 = r0.a;
        r7 = 0;
        r9 = r5[r7];
        if (r6 == 0) goto L_0x03e0;
    L_0x03df:
        goto L_0x03e2;
    L_0x03e0:
        r6 = r5[r2];
    L_0x03e2:
        r2 = 2;
        r2 = r5[r2];
        if (r8 == 0) goto L_0x03e8;
    L_0x03e7:
        goto L_0x03eb;
    L_0x03e8:
        r7 = 3;
        r8 = r5[r7];
    L_0x03eb:
        r4.setCompoundDrawablesRelativeWithIntrinsicBounds(r9, r6, r2, r8);
        goto L_0x0412;
    L_0x03ef:
        r4 = r0.a;
        r4 = r4.getCompoundDrawablesRelative();
        r7 = r0.a;
        if (r9 == 0) goto L_0x03fa;
    L_0x03f9:
        goto L_0x03fe;
    L_0x03fa:
        r9 = 0;
        r10 = r4[r9];
        r9 = r10;
    L_0x03fe:
        if (r6 == 0) goto L_0x0401;
    L_0x0400:
        goto L_0x0403;
    L_0x0401:
        r6 = r4[r2];
    L_0x0403:
        if (r5 == 0) goto L_0x0406;
    L_0x0405:
        goto L_0x0409;
    L_0x0406:
        r2 = 2;
        r5 = r4[r2];
    L_0x0409:
        if (r8 == 0) goto L_0x040c;
    L_0x040b:
        goto L_0x040f;
    L_0x040c:
        r2 = 3;
        r8 = r4[r2];
    L_0x040f:
        r7.setCompoundDrawablesRelativeWithIntrinsicBounds(r9, r6, r5, r8);
    L_0x0412:
        r2 = 11;
        r4 = r1.hasValue(r2);
        if (r4 == 0) goto L_0x0448;
    L_0x041a:
        r4 = r1.hasValue(r2);
        if (r4 == 0) goto L_0x042e;
    L_0x0420:
        r4 = 0;
        r4 = r1.getResourceId(r2, r4);
        if (r4 == 0) goto L_0x042e;
    L_0x0427:
        r4 = b.b.d.a.a.a(r13, r4);
        if (r4 == 0) goto L_0x042e;
    L_0x042d:
        goto L_0x0432;
    L_0x042e:
        r4 = r1.getColorStateList(r2);
    L_0x0432:
        r2 = r0.a;
        java.util.Objects.requireNonNull(r2);
        r5 = 24;
        if (r12 < r5) goto L_0x043f;
    L_0x043b:
        r2.setCompoundDrawableTintList(r4);
        goto L_0x0448;
    L_0x043f:
        r5 = r2 instanceof b.i.l.e;
        if (r5 == 0) goto L_0x0448;
    L_0x0443:
        r2 = (b.i.l.e) r2;
        r2.setSupportCompoundDrawablesTintList(r4);
    L_0x0448:
        r2 = 12;
        r4 = r1.hasValue(r2);
        if (r4 == 0) goto L_0x046f;
    L_0x0450:
        r2 = r1.getInt(r2, r3);
        r4 = 0;
        r2 = b.b.h.o.c(r2, r4);
        r4 = r0.a;
        java.util.Objects.requireNonNull(r4);
        r5 = 24;
        if (r12 < r5) goto L_0x0466;
    L_0x0462:
        r4.setCompoundDrawableTintMode(r2);
        goto L_0x046f;
    L_0x0466:
        r5 = r4 instanceof b.i.l.e;
        if (r5 == 0) goto L_0x046f;
    L_0x046a:
        r4 = (b.i.l.e) r4;
        r4.setSupportCompoundDrawablesTintMode(r2);
    L_0x046f:
        r2 = 14;
        r2 = r1.getDimensionPixelSize(r2, r3);
        r4 = 17;
        r4 = r1.getDimensionPixelSize(r4, r3);
        r5 = 18;
        r5 = r1.getDimensionPixelSize(r5, r3);
        r1.recycle();
        if (r2 == r3) goto L_0x048b;
    L_0x0486:
        r1 = r0.a;
        b.i.b.f.V0(r1, r2);
    L_0x048b:
        if (r4 == r3) goto L_0x0492;
    L_0x048d:
        r1 = r0.a;
        b.i.b.f.W0(r1, r4);
    L_0x0492:
        if (r5 == r3) goto L_0x0499;
    L_0x0494:
        r1 = r0.a;
        b.i.b.f.Y0(r1, r5);
    L_0x0499:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.b.h.k.e(android.util.AttributeSet, int):void");
    }

    public void f(Context context, int i) {
        f0 f0Var = new f0(context, context.obtainStyledAttributes(i, b.w));
        if (f0Var.o(14)) {
            this.a.setAllCaps(f0Var.a(14, false));
        }
        i = VERSION.SDK_INT;
        if (i < 23 && f0Var.o(3)) {
            ColorStateList c = f0Var.c(3);
            if (c != null) {
                this.a.setTextColor(c);
            }
        }
        if (f0Var.o(0) && f0Var.f(0, -1) == 0) {
            this.a.setTextSize(0, 0.0f);
        }
        l(context, f0Var);
        if (i >= 26 && f0Var.o(13)) {
            String m = f0Var.m(13);
            if (m != null) {
                this.a.setFontVariationSettings(m);
            }
        }
        f0Var.b.recycle();
        Typeface typeface = this.l;
        if (typeface != null) {
            this.a.setTypeface(typeface, this.j);
        }
    }

    public void g(int i, int i2, int i3, int i4) throws IllegalArgumentException {
        l lVar = this.i;
        if (lVar.i()) {
            DisplayMetrics displayMetrics = lVar.j.getResources().getDisplayMetrics();
            lVar.j(TypedValue.applyDimension(i4, (float) i, displayMetrics), TypedValue.applyDimension(i4, (float) i2, displayMetrics), TypedValue.applyDimension(i4, (float) i3, displayMetrics));
            if (lVar.g()) {
                lVar.a();
            }
        }
    }

    public void h(int[] iArr, int i) throws IllegalArgumentException {
        l lVar = this.i;
        if (lVar.i()) {
            int length = iArr.length;
            int i2 = 0;
            if (length > 0) {
                int[] iArr2 = new int[length];
                if (i == 0) {
                    iArr2 = Arrays.copyOf(iArr, length);
                } else {
                    DisplayMetrics displayMetrics = lVar.j.getResources().getDisplayMetrics();
                    while (i2 < length) {
                        iArr2[i2] = Math.round(TypedValue.applyDimension(i, (float) iArr[i2], displayMetrics));
                        i2++;
                    }
                }
                lVar.f = lVar.b(iArr2);
                if (!lVar.h()) {
                    StringBuilder g = c.b.a.a.a.g("None of the preset sizes is valid: ");
                    g.append(Arrays.toString(iArr));
                    throw new IllegalArgumentException(g.toString());
                }
            }
            lVar.g = false;
            if (lVar.g()) {
                lVar.a();
            }
        }
    }

    public void i(int i) {
        l lVar = this.i;
        if (!lVar.i()) {
            return;
        }
        if (i == 0) {
            lVar.a = 0;
            lVar.d = -1.0f;
            lVar.e = -1.0f;
            lVar.c = -1.0f;
            lVar.f = new int[0];
            lVar.b = false;
        } else if (i == 1) {
            DisplayMetrics displayMetrics = lVar.j.getResources().getDisplayMetrics();
            lVar.j(TypedValue.applyDimension(2, 12.0f, displayMetrics), TypedValue.applyDimension(2, 112.0f, displayMetrics), 1.0f);
            if (lVar.g()) {
                lVar.a();
            }
        } else {
            throw new IllegalArgumentException(c.b.a.a.a.A("Unknown auto-size text type: ", i));
        }
    }

    public void j(ColorStateList colorStateList) {
        if (this.h == null) {
            this.h = new d0();
        }
        d0 d0Var = this.h;
        d0Var.a = colorStateList;
        d0Var.d = colorStateList != null;
        this.b = d0Var;
        this.c = d0Var;
        this.d = d0Var;
        this.e = d0Var;
        this.f = d0Var;
        this.g = d0Var;
    }

    public void k(Mode mode) {
        if (this.h == null) {
            this.h = new d0();
        }
        d0 d0Var = this.h;
        d0Var.b = mode;
        d0Var.c = mode != null;
        this.b = d0Var;
        this.c = d0Var;
        this.d = d0Var;
        this.e = d0Var;
        this.f = d0Var;
        this.g = d0Var;
    }

    public final void l(Context context, f0 f0Var) {
        int j;
        int i = VERSION.SDK_INT;
        this.j = f0Var.j(2, this.j);
        boolean z = false;
        if (i >= 28) {
            j = f0Var.j(11, -1);
            this.k = j;
            if (j != -1) {
                this.j = (this.j & 2) | 0;
            }
        }
        j = 10;
        if (f0Var.o(10) || f0Var.o(12)) {
            Typeface i2;
            this.l = null;
            if (f0Var.o(12)) {
                j = 12;
            }
            int i3 = this.k;
            int i4 = this.j;
            if (!context.isRestricted()) {
                try {
                    i2 = f0Var.i(j, this.j, new a(i3, i4, new WeakReference(this.a)));
                    if (i2 != null) {
                        if (i < 28 || this.k == -1) {
                            this.l = i2;
                        } else {
                            this.l = Typeface.create(Typeface.create(i2, 0), this.k, (this.j & 2) != 0);
                        }
                    }
                    this.m = this.l == null;
                } catch (NotFoundException | UnsupportedOperationException unused) {
                }
            }
            if (this.l == null) {
                String m = f0Var.m(j);
                if (m != null) {
                    if (i < 28 || this.k == -1) {
                        this.l = Typeface.create(m, this.j);
                    } else {
                        i2 = Typeface.create(m, 0);
                        int i5 = this.k;
                        if ((this.j & 2) != 0) {
                            z = true;
                        }
                        this.l = Typeface.create(i2, i5, z);
                    }
                }
            }
            return;
        }
        if (f0Var.o(1)) {
            this.m = false;
            int j2 = f0Var.j(1, 1);
            if (j2 == 1) {
                this.l = Typeface.SANS_SERIF;
            } else if (j2 == 2) {
                this.l = Typeface.SERIF;
            } else if (j2 == 3) {
                this.l = Typeface.MONOSPACE;
            }
        }
    }
}
